package com.informatics.polymer.server.Polymerisation;

import nu.xom.Document;

import org.xmlcml.cml.element.CMLFragment;
import org.xmlcml.cml.element.CMLMolecule;

/**
 * Simple interface to generate fully atomistic CML documents and polymers.
 * 
 * @author Ed Cannon
 * @version 1.0
 */
public interface Polymerisation {

	// TODO Suggest removing this - serialize as a utility method.
	/**
	 * Generates XML string representation of the built polymer.
	 * 
	 * @return String representation of polymer.
	 * @deprecated
	 */
	String generatePML();

	/**
	 * Generate a macromolecule that is an instance of this polymerisation.
	 * 
	 * @return CMLMolecule representation of polymer.
	 */
	CMLMolecule getPolymer();

	/**
	 * Produce an XOM document that represents this polymerisation process (as
	 * opposed to an instance of the results of it).
	 * 
	 * @throws UnbuildableException
	 * @return Document representation of polymer.
	 */
	Document createCML() throws UnbuildableException;
	
	/**
	 * Builds CMLFragment for basic PML and PML-Intermediate.
	 * 
	 * @return CMLFragment
	 */
	CMLFragment getFragment();
}